package org.sao.admin.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.sao.admin.mapper.SysUserMapper;
import org.sao.admin.model.entity.SysUser;
import org.sao.admin.service.SysUserService;
import org.sao.common.vo.UserVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;


/**
 * @author lengleng
 * @date 2017/10/31
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {
    private static final Logger logger = LoggerFactory.getLogger(SysUserServiceImpl.class);
    private static final PasswordEncoder ENCODER = new BCryptPasswordEncoder();
  
    @Autowired
    private SysUserMapper sysUserMapper;
  
  

    @Override
    @Cacheable(value = "user_details", key = "#username")
    public UserVo findUserByUsername(String username) {
        return sysUserMapper.selectUserVoByUsername(username);
    }

  

}
